Updated for 2.6.1 by: The Tech Support Team, Pictorius Incorporated
Contents: Progress Window.pgs
Progress Window ReadMe
New Classes
Progress Window
Progress Bar
Spinning Cursor
Needs Prograph Extensions:
The default configuration of your 'Prograph Extensions' folder.
Needs Libraries to Compile:
SCLibrary 2.6
Library 2.6
Description
-----------
This example shows how to implement a progress window with a stop button, a progress bar and a spinning watch cursor. The example window is much like the progress window used by the System 7 Finder for file copying.
How to Use in Your Program
-------------------------
First, you will need to load the three classes listed under "New Classes" into your file. You will also need to use ResEdit to copy the cursor resources from "Progress Window.pgs" into your file. The spinning watch cursor resources have type 'CURS', id's 256 through 263.
When your application is about to begin a lengthy operation, create an instance of "Progress Window" and call the "Open Progress" method to open the window, then while the operation is being performed, call "Handle Event" fairly often to give the user a chance to press the stop button. Call "Advance Progress" to update the progress bar. You may also want to call "Change Message" to change the text of the progress window, if your operation has several distinct parts.
"Handle Event" checks for events and also spins the watch cursor. It is based on the "Modal Window" example on the 2.5 distribution disks. "Mouse Down" changes the cursor to an arrow when the user clicks in the button or in the drag area. "Close" changes the cursor back to an arrow before the progress window is closed.